#!/usr/bin/env node

const cp = require('child_process');

console.log('I am father process. PID:', process.pid);

//cp.fork('cat',['03.child.js']);//报错
cp.fork('./03-child.js');//只能执行nodejs脚本外部程序，更高效

//默认父子进程分离
setTimeout(() => {
  console.log('父进程结束啦!');
}, 5000);

